﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.ComponentModel;

namespace UIPrototyper
{
    class TextBoxProperties : Property, IChanged
    {
        private CustomTextBox textBox;

        public TextBoxProperties(CustomTextBox pTextBox)
        {
            this.textBox = pTextBox;
        }

        [DescriptionAttribute("O nome da TextBox"),
        CategoryAttribute("TextBox")]
        public override string Nome
        {
            get { return this.textBox.Name; }
            set { this.textBox.Name = value; LaunchChangedEvent(this.textBox); }
        }

        [DescriptionAttribute("O conteúdo do TextBox."),
        CategoryAttribute("TextBox")]
        public string Conteudo
        {
            get { return this.textBox.Text; }
            set { this.textBox.Text = value; LaunchChangedEvent(this.textBox); }
        }

        #region IChanged Members

        public event ChangedHandler iChanged;

        public void LaunchChangedEvent(IChanged pChangedObject)
        {
            if (iChanged != null)
            {
                iChanged(pChangedObject);
            }
        }

        #endregion
    }
}
